#include "stdafx.h"
#include "HiranipraCommon.h"
#include "ClientApp.h"

using namespace Hiranipra;
using namespace Hiranipra::Client;

ClientApp _clientApp;

int _tmain(int argc, _TCHAR* argv[])
{
	wstring appPath = wstring( argv[ 0 ] );
	int slash = appPath.find_last_of( L"/" );
	if( slash <= 0 )
		slash = appPath.find_last_of( L"\\" );
	appPath = appPath.substr( 0, slash + 1 );

	vector<wstring> args;
	for( int n = 1; n < argc; n++ )
		args.push_back( wstring( argv[ n ] ) );
	
	_clientApp.RegisterAssembly( L"Hiranipra.Platform.OpenGL.dll" );
	_clientApp.RegisterAssembly( L"Hiranipra.Platform.PhysFS.dll" );
	_clientApp.RegisterAssembly( L"Hiranipra.Platform.Windows.dll" );

	return _clientApp.Start( appPath, args );
}
